package com.th.SqlProvider;

import com.th.bean.Employye;
import com.th.util.Common;
import org.apache.ibatis.jdbc.SQL;

public class EmployyeMapperProvider {
    public String update(final Employye employye){
        return new SQL(){{
            UPDATE("employee");
            if(!Common.isEmpty(employye.getAddress())){
                SET("address = #{address}");
            }
            if(employye.getAge()!=null){
                SET("age =#{age}");
            }
            if(employye.getSex()!=null){
                SET("sex =#{sex}");
            }
            if(!Common.isEmpty(employye.getName())){
                SET("name =#{name}");
            }
            WHERE("id=#{id}");
        }



        }.toString();
    }
}
